//
//  TopicModel.m
//  BobNews
//
//  Created by lanou3g on 16/5/6.
//  Copyright © 2016年 YJC. All rights reserved.
//

#import "TopicModel.h"
#import "TextModel.h"
#import "TopicThirdModel.h"
#import "TopicSecondModel.h"
#import "TopicFirstModel.h"
#import "TopicFourthModel.h"
#import "TopicFifthModel.h"
#import "TopicNineModel.h"
#import "TopicEightModel.h"
#import "TopicSevenModel.h"
#import "TopicSixModel.h"
@implementation TopicModel
- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
}

+ (instancetype)modelWithDictionary:(NSDictionary *)dictionary {
    NSArray *picurl = dictionary[@"picurl"];
    NSInteger count = picurl.count;
    switch (count) {
        case 0:
        {
            TextModel *textModel = [[TextModel alloc]init];
            [textModel setValuesForKeysWithDictionary:dictionary];
            return textModel;
        }
            break;
            case 1:
        {
            TopicFirstModel *firstModel = [[TopicFirstModel alloc]init];
            [firstModel setValuesForKeysWithDictionary:dictionary];
            return firstModel;
        }
            break;
            case 2:
        {
            TopicSecondModel *secondModel = [[TopicSecondModel alloc]init];
            [secondModel setValuesForKeysWithDictionary:dictionary];
            return secondModel;
        }
            break;
            case 3:
        {
            TopicThirdModel *thirdModel = [[TopicThirdModel alloc]init];
            [thirdModel setValuesForKeysWithDictionary:dictionary];
            return thirdModel;
        }
            break;
        case 4:
        {
            TopicFourthModel *fourthModel = [[TopicFourthModel alloc]init];
            [fourthModel setValuesForKeysWithDictionary:dictionary];
            return fourthModel;
        }
            break;
        case 5:
        {
            TopicFifthModel *fifthModel = [[TopicFifthModel alloc]init];
            [fifthModel setValuesForKeysWithDictionary:dictionary];
            return fifthModel;
        }
            break;
        case 6:
        {
            TopicSixModel *sixModel = [[TopicSixModel alloc]init];
            [sixModel setValuesForKeysWithDictionary:dictionary];
            return sixModel;
        }
            break;
        case 7:
        {
            TopicSevenModel *sevenModel = [[TopicSevenModel alloc]init];
            [sevenModel setValuesForKeysWithDictionary:dictionary];
            return sevenModel;
        }
            break;
        case 8:
        {
            TopicEightModel *eightModel = [[TopicEightModel alloc]init];
            [eightModel setValuesForKeysWithDictionary:dictionary];
            return eightModel;
        }
            break;

        case 9:
        {
            TopicNineModel *nineModel = [[TopicNineModel alloc]init];
            [nineModel setValuesForKeysWithDictionary:dictionary];
            return nineModel;
        }
            break;

           default:
            break;
    }
     
    return nil;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}
@end
